import initialState from '../state';

function appReducer(state = initialState.app, action){
    switch(action.type){
        case 'CHANGE_NOWPAGE_WITH_HEADER_STATE':
            return Object.assign({},state,{
                mainNowPage:action.mainNowPage
            });
        case 'CHANGE_SHOW_STATUS':
            return Object.assign({}, state, {
                publishShow: action.status
            })
        case 'GET_CITY_LIST_SUCCESS':
            return Object.assign({}, state, {
                cityList: action.data
            })
        case 'EDIT_CITY_SUCCESS':
            return Object.assign({}, state, {
                city: action.data.data
            })
        case 'GET_CITY_SUCCESS':
            return Object.assign({}, state, {
                city: action.data.city
            })
        default :
            return state;
    }
}

export default appReducer;